Scanning The Operating Parameters

First we set up the FPE.


In [1]:
from tessfpe.dhu.fpe import FPE
from tessfpe.dhu.unit_tests import check_house_keeping_voltages
fpe1 = FPE(1, debug=False, preload=False, FPE_Wrapper_version='6.1.1')
print fpe1.version
if check_house_keeping_voltages(fpe1):
    print "Wrapper load complete. Interface voltages OK."


Observatory Simulator Version 1.6c - Oct  8 2015 11:55:03
Wrapper load complete. Interface voltages OK.

We now walk through setting each value from its high to its low.


In [2]:
data = []

for i in range(100,-1,-1):
    set_values = {}
    for k in range(len(fpe1.ops.address)):
        if fpe1.ops.address[k] is None:
            continue
        low = fpe1.ops.address[k].low
        high = fpe1.ops.address[k].high
        name = fpe1.ops.address[k].name
        set_values[name] = fpe1.ops.address[k].value = low + i / 100. * (high - low)
    fpe1.ops.send()
    data.append({"set values": set_values,
                 "measured values": fpe1.house_keeping["analogue"]})

In [3]:
fpe1.ops.heater_1_current = fpe1.ops.heater_2_current = fpe1.ops.heater_3_current = fpe1.ops.heater_3_current.low
fpe1.ops.send()

In [6]:
set_min_values = {}
set_max_values = {}
measured_min_values = {}
measured_max_values = {}
for datum in data:
    for k in range(len(fpe1.ops.address)):
        if fpe1.ops.address[k] is None:
            continue
        name = fpe1.ops.address[k].name
        if "offset" in name:
            continue
        if name not in measured_min_values or \
           measured_min_values[name] > datum["measured values"][name]:
            measured_min_values[name] = datum["measured values"][name]
        if name not in measured_max_values or \
           measured_max_values[name] < datum["measured values"][name]:
            measured_max_values[name] = datum["measured values"][name]
        if name not in set_min_values or \
           set_min_values[name] > datum["set values"][name]:
            set_min_values[name] = datum["set values"][name]
        if name not in set_max_values or \
           set_max_values[name] < datum["set values"][name]:
            set_max_values[name] = datum["set values"][name]

for k in range(len(fpe1.ops.address)):
    if fpe1.ops.address[k] is None:
        continue
    name = fpe1.ops.address[k].name
    if "offset" in name:
        continue
    unit = fpe1.ops.address[k].unit
    expected_low = fpe1.ops.address[k].low
    actual_minimum = measured_min_values[name]
    expected_high = fpe1.ops.address[k].high
    actual_maximum = measured_max_values[name]
    if expected_low < expected_high:
        actual_low = actual_minimum
        actual_high = actual_maximum
    else:
        actual_high = actual_minimum
        actual_low = actual_maximum
    
    print "{name}:".format(name = name)
    print "\tExpected Low: {expected_low} {unit}".format(expected_low=expected_low,
                                                         unit=unit)
    print "\tActual Low: {actual_low} {unit}".format(actual_low=actual_low,
                                                     unit=unit)
    print "\tExpected High: {expected_high} {unit}".format(expected_high=expected_high,
                                                            unit=unit)
    print "\tActual High: {actual_high} {unit}".format(actual_high=actual_high,
                                                       unit=unit)
    print


ccd1_output_gate:
	Expected Low: -8.0 V
	Actual Low: -7.97657775879 V
	Expected High: 4.0 V
	Actual High: 6.5419921875 V

ccd1_input_gate_1:
	Expected Low: -8.0 V
	Actual Low: -7.87637329102 V
	Expected High: 4.0 V
	Actual High: 6.42063903809 V

ccd1_input_gate_2:
	Expected Low: -8.0 V
	Actual Low: -7.85018920898 V
	Expected High: 4.0 V
	Actual High: 6.59436035156 V

ccd1_scupper:
	Expected Low: 0.0 V
	Actual Low: 0.0463256835938 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd1_reset_drain:
	Expected Low: 0.0 V
	Actual Low: 0.0211486816406 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd1_backside:
	Expected Low: 0.0 V
	Actual Low: 0.0151062011719 V
	Expected High: 5.0 V
	Actual High: 7.96398925781 V

ccd1_substrate:
	Expected Low: 0.0 V
	Actual Low: -0.367858886719 V
	Expected High: -50.0 V
	Actual High: -80.0280761719 V

ccd2_output_gate:
	Expected Low: -8.0 V
	Actual Low: -7.98110961914 V
	Expected High: 4.0 V
	Actual High: 6.29475402832 V

ccd2_input_gate_1:
	Expected Low: -8.0 V
	Actual Low: -7.96650695801 V
	Expected High: 4.0 V
	Actual High: 6.52688598633 V

ccd2_input_gate_2:
	Expected Low: -8.0 V
	Actual Low: -7.94737243652 V
	Expected High: 4.0 V
	Actual High: 6.2816619873 V

ccd2_scupper:
	Expected Low: 0.0 V
	Actual Low: 0.00100708007812 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd2_reset_drain:
	Expected Low: 0.0 V
	Actual Low: 0.0251770019531 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd2_backside:
	Expected Low: 0.0 V
	Actual Low: 0.0171203613281 V
	Expected High: 5.0 V
	Actual High: 7.7575378418 V

ccd2_substrate:
	Expected Low: 0.0 V
	Actual Low: -0.325317382812 V
	Expected High: -50.0 V
	Actual High: -80.6536865234 V

ccd3_output_gate:
	Expected Low: -8.0 V
	Actual Low: -7.96449279785 V
	Expected High: 4.0 V
	Actual High: 6.16836547852 V

ccd3_input_gate_1:
	Expected Low: -8.0 V
	Actual Low: -7.90255737305 V
	Expected High: 4.0 V
	Actual High: 6.34007263184 V

ccd3_input_gate_2:
	Expected Low: -8.0 V
	Actual Low: -7.88795471191 V
	Expected High: 4.0 V
	Actual High: 6.57421875 V

ccd3_scupper:
	Expected Low: 0.0 V
	Actual Low: 0.0448150634766 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd3_reset_drain:
	Expected Low: 0.0 V
	Actual Low: 0.0790557861328 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd3_backside:
	Expected Low: 0.0 V
	Actual Low: 0.0 V
	Expected High: 5.0 V
	Actual High: 8.07023620605 V

ccd3_substrate:
	Expected Low: 0.0 V
	Actual Low: -0.0775756835938 V
	Expected High: -50.0 V
	Actual High: -77.5256347656 V

ccd4_output_gate:
	Expected Low: -8.0 V
	Actual Low: -7.93528747559 V
	Expected High: 4.0 V
	Actual High: 6.38589477539 V

ccd4_input_gate_1:
	Expected Low: -8.0 V
	Actual Low: -7.95291137695 V
	Expected High: 4.0 V
	Actual High: 6.26856994629 V

ccd4_input_gate_2:
	Expected Low: -8.0 V
	Actual Low: -8.00779724121 V
	Expected High: 4.0 V
	Actual High: 6.25598144531 V

ccd4_scupper:
	Expected Low: 0.0 V
	Actual Low: 0.00151062011719 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd4_reset_drain:
	Expected Low: 0.0 V
	Actual Low: 0.00604248046875 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd4_backside:
	Expected Low: 0.0 V
	Actual Low: -0.000503540039062 V
	Expected High: 5.0 V
	Actual High: 7.78926086426 V

ccd4_substrate:
	Expected Low: 0.0 V
	Actual Low: -0.107604980469 V
	Expected High: -50.0 V
	Actual High: -80.8688964844 V

ccd1_parallel_low:
	Expected Low: 0.0 V
	Actual Low: -1.88374328613 V
	Expected High: -13.2 V
	Actual High: -13.4742279053 V

ccd1_serial_high:
	Expected Low: 15.0 V
	Actual Low: 4.68544006348 V
	Expected High: -10.3 V
	Actual High: -8.8275604248 V

ccd1_reset_high:
	Expected Low: 15.0 V
	Actual Low: 14.720489502 V
	Expected High: -10.3 V
	Actual High: -10.2188415527 V

ccd1_input_diode_high:
	Expected Low: 0.0 V
	Actual Low: 0.0 V
	Expected High: 15.0 V
	Actual High: 14.9606781006 V

ccd1_input_diode_low:
	Expected Low: 0.0 V
	Actual Low: 0.00151062011719 V
	Expected High: 15.0 V
	Actual High: 15.043762207 V

ccd2_parallel_low:
	Expected Low: 0.0 V
	Actual Low: -1.88877868652 V
	Expected High: -13.2 V
	Actual High: -13.4923553467 V

ccd2_serial_high:
	Expected Low: 15.0 V
	Actual Low: 4.67587280273 V
	Expected High: -10.3 V
	Actual High: -9.60150146484 V

ccd2_reset_high:
	Expected Low: 15.0 V
	Actual Low: 14.7058868408 V
	Expected High: -10.3 V
	Actual High: -9.8910369873 V

ccd2_input_diode_high:
	Expected Low: 0.0 V
	Actual Low: 0.0166168212891 V
	Expected High: 15.0 V
	Actual High: 15.1318817139 V

ccd2_input_diode_low:
	Expected Low: 0.0 V
	Actual Low: 0.00100708007812 V
	Expected High: 15.0 V
	Actual High: 14.8876647949 V

ccd3_parallel_low:
	Expected Low: 0.0 V
	Actual Low: -1.89331054688 V
	Expected High: -13.2 V
	Actual High: -15.894744873 V

ccd3_serial_high:
	Expected Low: 15.0 V
	Actual Low: 4.67134094238 V
	Expected High: -10.3 V
	Actual High: -8.79382324219 V

ccd3_reset_high:
	Expected Low: 15.0 V
	Actual Low: 14.8378143311 V
	Expected High: -10.3 V
	Actual High: -8.61557006836 V

ccd3_input_diode_high:
	Expected Low: 0.0 V
	Actual Low: 0.0 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd3_input_diode_low:
	Expected Low: 0.0 V
	Actual Low: 0.0 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd4_parallel_low:
	Expected Low: 0.0 V
	Actual Low: -1.92050170898 V
	Expected High: -13.2 V
	Actual High: -14.9702453613 V

ccd4_serial_high:
	Expected Low: 15.0 V
	Actual Low: 4.66630554199 V
	Expected High: -10.3 V
	Actual High: -8.70671081543 V

ccd4_reset_high:
	Expected Low: 15.0 V
	Actual Low: 14.7315673828 V
	Expected High: -10.3 V
	Actual High: -9.03652954102 V

ccd4_input_diode_high:
	Expected Low: 0.0 V
	Actual Low: -0.000503540039062 V
	Expected High: 15.0 V
	Actual High: 16.5 V

ccd4_input_diode_low:
	Expected Low: 0.0 V
	Actual Low: 0.0140991210938 V
	Expected High: 15.0 V
	Actual High: 16.5 V

heater_1_current:
	Expected Low: 0.0 mA
	Actual Low: 1.9245300293 mA
	Expected High: 227.0 mA
	Actual High: 273.0 mA

heater_2_current:
	Expected Low: 0.0 mA
	Actual Low: 1.01641845703 mA
	Expected High: 227.0 mA
	Actual High: 273.0 mA

heater_3_current:
	Expected Low: 0.0 mA
	Actual Low: 1.04974365234 mA
	Expected High: 227.0 mA
	Actual High: 273.0 mA


In [7]:
%matplotlib inline
%config InlineBackend.figure_format = 'svg'

In [8]:
import numpy as np
import matplotlib.pyplot as plt
import pylab

In [9]:
from collections import defaultdict

# Collect the set and measured values
X = defaultdict(list)
Y = defaultdict(list)
for datum in data:
    for name in datum['set values']:
        if name not in datum['measured values']:
            continue
        X[name].append(datum['set values'][name])
        Y[name].append(datum['measured values'][name])

In [12]:
def get_range_square(X,Y):
    return [min(X + Y)-1, max(X + Y)+1]

In [16]:
# Plot the set vs. measured values
for nom in sorted(X.keys()):
    x = X[nom]
    y = Y[nom]
    
    ran = get_range_square(x,y)
    pylab.ylim(ran)
    pylab.xlim(ran)
    plt.axes().set_aspect(1)
    plt.title(nom)
    plt.scatter(x,y,color='red')
    pylab.grid(True)
    minv,maxv=ran
    plt.plot(np.arange(minv,maxv+1),np.arange(minv,maxv+1))
    plt.show()



In [ ]: